package app.caretrack.model;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "AlarmNotifications")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class AlarmNotification extends BaseModel {

    private AlarmNotificationPlan notificationPlan;

    private AlarmNotificationAlarm notificationAlarm;

    @ManyToOne(fetch = FetchType.EAGER)
    public AlarmNotificationPlan getNotificationPlan() {
        return this.notificationPlan;
    }

    public void setNotificationPlan(AlarmNotificationPlan notificationPlan) {
        this.notificationPlan = notificationPlan;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "Alarm_Id")
    public AlarmNotificationAlarm getNotificationAlarm() {
        return this.notificationAlarm;
    }

    public void setNotificationAlarm(AlarmNotificationAlarm notificationAlarm) {
        this.notificationAlarm = notificationAlarm;
    }

}
